﻿@{
    ViewBag.Title = "MyCenter";
    Layout = "~/Views/Shared/Template.cshtml";
}
<style>
    #divLeft {
        width: 24%;
    }

    #divContent {
        width: 50%;
        height: 500px;
        margin-bottom: 100px;
    }
</style>

<style>
    #myCarousel {
        
    }
</style>

@using Partner.MVC.Models;
@{
    var user = Session["LoginUser"] as User_Info;
}

<div style="height: 300px;width: 100%;background:url(/static/hbweb/images/me.jpg);">
    <div class="container">
        <div class="header-message">
            <img class="fl" src="http://pic.huobanchina.com/o_1bp7omfg8e821pc4bbg1u8g1ifl9.jpeg" alt="" />
            <div class="fl header-text">
                <h3 class="user-name">@user.Use_Name </h3>
                <i class="icon-fabu3 point user-namei"></i>
            </div>
            <a id="AlterPwd" style="width:85px;" data-toggle="modal" data-target="#myModal" class="fr fn-font-hover-blue change change-password">
                修改密码
            </a>
        </div>
    </div>
</div>

<div class="bgcSil">
    <div class="container">
        <div class="mt30">
            <ul id="divLeft" class="nav navbar-nav"></ul>
            <div id="divContent" style="margin:0 auto;">

                <div id="myCarousel" class="carousel slide" style="width:760px;">
                    <!-- 轮播（Carousel）指标 -->
                    <ol class="carousel-indicators">
                        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                        <li data-target="#myCarousel" data-slide-to="1"></li>
                        <li data-target="#myCarousel" data-slide-to="2"></li>
                        <li data-target="#myCarousel" data-slide-to="3"></li>
                        <li data-target="#myCarousel" data-slide-to="4"></li>
                        <li data-target="#myCarousel" data-slide-to="5"></li>
                    </ol>
                    <!-- 轮播（Carousel）项目 -->
                    <div class="carousel-inner">
                        <div class="item active">
                            <img src="~/Img/loft1.jpg" />
                            <img src="" alt="客厅">
                        </div>
                        <div class="item">
                            <img src="~/Img/loft2.jpg" />
                            <img src="" alt="沙发">
                        </div>
                        <div class="item">
                            <img src="~/Img/loft3.jpg" />
                            <img src="" alt="走廊">
                        </div>
                        <div class="item">
                            <img src="~/Img/loft4.jpg" />
                            <img src="" alt="主卧">
                        </div>
                        <div class="item">
                            <img src="~/Img/loft5.jpg" />
                            <img src="" alt="次卧">
                        </div>
                    </div>
                    <!-- 轮播（Carousel）导航 -->
                    <a class="carousel-control left" href="#myCarousel"
                       data-slide="prev">&lsaquo;</a>
                    <a  class="carousel-control right" href="#myCarousel"
                       data-slide="next">&rsaquo;</a>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    //设置时间
    $("#myCarousel").carousel({
        interval: 2000
    })
</script>

<script>
    ParentNav();
    // 绑定根节点
    function ParentNav() {
        $.ajax({
            type: "post",
            url: "/Partner/LeftNav",
            dataType: "json",
            success: function (data) {
                var htmltab = "";
                for (var i = 0; i < data.length; i++) {
                    htmltab += "<li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" style=\"width: 175px;font-size: 16px;\">" + data[i].Lar_Name + "</a>" + SonNav(data[i].Limit_Id) + "</li>";
                }
                $("#divLeft").append(htmltab);
            },
            error: function (err) {
                alert(err);
            }
        })
    }
    // 绑定子节点
    function SonNav(id) {
        var html1 = "";
        $.ajax({
            type: "post",
            url: "/Partner/LeftSon",
            data: { pid: id },
            dataType: "json",
            async: false,
            success: function (data) {
                var strhtml = "<ul class=\"dropdown-menu\">"
                for (var i = 0; i < data.length; i++) {
                    strhtml += "<li><a href=\"" + data[i].Limit_Url + "\">" + data[i].Limit_Name + "</a></li>"
                }
                strhtml += "</ul>";
                html1 = strhtml;
            }
        })
        return html1;
    }
</script>